import { ActiveBaseIcon } from "../icon/ActiveBaseIcon";
import { ResFileConst } from "../../../resource/ResFileConst";
import { GImageButton } from "../../../../../com/mui/controls/GImageButton";
import { GameController } from "../../../mvc/GameController";
import { ActiveIconChangeInfo } from "../../../model/ActiveIconChangeInfo";
import { ParamsConst } from "../../../../common/global/ParamsConst";
import { ProxyType } from "../../../../common/global/ProxyType";
import { EffectManager } from "../../../manager/EffectManager";
import { FilterConst } from "../../../../component/gconst/FilterConst";
//class ChristmasIcon
    
    export  class ChristmasIcon extends ActiveBaseIcon
    {
        constructor(arg1: string=null)
        {
            super(arg1);
            arg1 = ResFileConst.ChristmasActive;
            return;
        }

        protected /* override */ initUI(): void
        {
            super.initUI();
            this._imgLoadedBtn = new GImageButton();
            this._imgLoadedBtn.setSize(60, 50);
            this._imgLoadedBtn.setStyle("upSkin", new Object /* flash.display.Bitmap */());
            this._imgLoadedBtn.setStyle("overSkin", new Object /* flash.display.Bitmap */());
            this._imgLoadedBtn.setStyle("disabledSkin", new Object /* flash.display.Bitmap */());
            this._imgLoadedBtn.setStyle("downSkin", new Object /* flash.display.Bitmap */());
            this._imgLoadedBtn.label = "";
            this.addChild(this._imgLoadedBtn);
            return;
        }

        protected /* override */ onMouseClickHandler(arg1: Object /* flash.events.MouseEvent */): void
        {
            GameController.christmasActive.updateList();
            return;
        }

        public /* override */ updateIconInfo(arg1: ActiveIconChangeInfo=null): void
        {
            if (arg1 && _iconInfo == arg1) 
            {
                return;
            }
            _iconInfo = arg1;
            if (_iconInfo) 
            {
                _fileName = _iconInfo.fileName;
            }
            if (ParamsConst.instance.proxyType != ProxyType.TW) 
            {
                this._imgLoadedBtn.upSkin = _fileName + "_upSkin.png";
                this._imgLoadedBtn.overSkin = _fileName + "_overSkin.png";
                this._imgLoadedBtn.disabledSkin = _fileName + "_upSkin.png";
                this._imgLoadedBtn.downSkin = _fileName + "_upSkin.png";
            }
            else 
            {
                this._imgLoadedBtn.upSkin = "TWActiveButton_upSkin.png";
                this._imgLoadedBtn.overSkin = "TWActiveButton_overSkin.png";
                this._imgLoadedBtn.disabledSkin = "TWActiveButton_upSkin.png";
                this._imgLoadedBtn.downSkin = "TWActiveButton_upSkin.png";
            }
            EffectManager.glowFilterReg(this, [FilterConst.guideTipsFilter], 0.6, 10, 5, 20);
            return;
        }

        /* internal */ /* var */_imgLoadedBtn: GImageButton;
    }
